﻿using System;
using System.IO;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Project.Module.Model;
using Project.Module.Model.CMS;
using Project.Engine.Utilities;

namespace Project.Module.DAO.BL
{
    public class CategoryBL : IBL.IBLTable<Category, int>
    {
        public List<CategoryModel> GetAllCate() {
            var query = from e in this.Context.Categories
                        where e.RootCategoryID == null
                        select new CategoryModel() { 
                            cateId = e.CategoryID,
                            cateName = e.CategoryName,
                        };

            if (query != null) {
                return query.ToList();
            }

            return null;
        }
    }
}
